<%@ page language="java" import="java.util.*,com.sjw.model.*"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
    request.setCharacterEncoding("UTF-8");
			String htmlData = request.getParameter("content1") != null
					? request.getParameter("content1")
					: "";
%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<meta charset="utf-8">
<title>YouAndMe</title>
<meta name="description" content="YouAndMe" />
<meta name="keywords" content="YouAndMe" />
<meta name="viewport"
	content="width=1000, initial-scale=1.0, maximum-scale=1.0">

<!-- Loading Bootstrap -->
<link href="dist/css/vendor/bootstrap.min.css" rel="stylesheet">
<!-- Loading Flat UI -->
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="dist/css/flat-ui.css" rel="stylesheet">
<link href="docs/assets/css/demo.css" rel="stylesheet">
<link rel="shortcut icon" href="img/pig.jpg">
<script src="dist/js/vendor/jquery.min.js"></script>
<!-- Loading Kindeditor -->
<link rel="stylesheet" href="js/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="js/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="js/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="js/kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="js/kindeditor/plugins/code/prettify.js"></script>
<script>
	KindEditor.ready(function(K) {
		K.create('textarea[name="message.content"]', {
			afterChange : function() {
				K('.word_count1').html(this.count());
				K('.word_count2').html(this.count('text'));
			}
		});
	});
	//  	隐藏texteare函数
	function changediv() {
		if (document.getElementById('texteare1').style.display == "none") {
			document.getElementById('texteare1').style.display = "";
		} else {
			document.getElementById('texteare1').style.display = "none";
		}

	};
	function sendText() {
		var text = $('textarea[name="message.content"]').val();
		alert(text);
	}
</script>
<script type="text/javascript">
	javascript: window.history.forward(1);
</script>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
      <script src="dist/js/vendor/html5shiv.js"></script>
      <script src="dist/js/vendor/respond.min.js"></script>
    <![endif]-->
</head>
<%-- <%@include  file="/checkLogin.jsp"%> --%>
<body style="background-image: url(img/bgimg.png);">
	<s:if test="#session.user">
		<jsp:include page="checkLogin.jsp"></jsp:include>
		<script type="text/javascript" src="js/backtop.js"></script>

		<div class="container">
			<div class="row">
				<div class="col-xs-12">
					<nav class="navbar navbar-inverse navbar-embossed"
						role="navigation">
						<div class="navbar-header">
							<button type="button" class="navbar-toggle"
								data-toggle="collapse" data-target="#navbar-collapse-01">
								<span class="sr-only">Toggle navigation</span>
							</button>
							<a class="navbar-brand" href="#">YouAndMe</a>
						</div>
						<div class="collapse navbar-collapse" id="navbar-collapse-01">
							<ul class="nav navbar-nav navbar-left">
								<li><a href="#fakelink">Menu Item<span
										class="navbar-unread">1</span></a></li>
								<li><a href="message_mymessage">My Messges</a></li>
								<li><a href="message_aboutme">About Me</a></li>
								<li><a id="changediv" href="javascript:void(0);"
									class="btn btn-block btn-lg btn-inverse" onclick="changediv()">Say
										a word</a></li>
							</ul>
							<form class="navbar-form navbar-right"
								action="message_searchContent" role="search" method="post">
								<div class="form-group">
									<div class="input-group">
										<input class="form-control" name="findContent"
											id="navbarInput-01" type="search" placeholder="Search">
										<span class="input-group-btn">
											<button type="submit" class="btn">
												<span class="fui-search"></span>
											</button>
										</span>
									</div>
								</div>
							</form>
						</div>
						<!-- /.navbar-collapse -->
					</nav>
					<!-- /navbar -->
				</div>
			</div>
			<!-- /row -->
			<!--       轮播图 -->
			<div class="container-fluid">
				<div class="row-fluid">
					<div class="span12">
						<div class="carousel slide" id="carousel-245515">
							<ol class="carousel-indicators">
								<li data-slide-to="0" data-target="#carousel-245515"></li>
								<li data-slide-to="1" data-target="#carousel-245515"></li>
								<li data-slide-to="2" data-target="#carousel-245515"
									class="active"></li>
							</ol>
							<div class="carousel-inner">
								<div class="item">
									<img alt="棒球" src="img/1.jpg" />
									<div class="carousel-caption">
										<p>棒球是一种以棒打球为主要特点，集体性、对抗性很强的球类运动项目，在美国、日本尤为盛行。</p>
									</div>
								</div>
								<div class="item">
									<img alt="" src="img/2.jpg" />
									<div class="carousel-caption">
										<p>
											冲浪是以海浪为动力，利用自身的高超技巧和平衡能力，搏击海浪的一项运动。运动员站立在冲浪板上，或利用腹板、跪板、充气的橡皮垫、划艇、皮艇等驾驭海浪的一项水上运动。
										</p>
									</div>
								</div>
								<div class="item active">
									<img alt="" src="img/3.jpg" />
									<div class="carousel-caption">
										<p>
											以自行车为工具比赛骑行速度的体育运动。1896年第一届奥林匹克运动会上被列为正式比赛项目。环法赛为最著名的世界自行车锦标赛。
										</p>
									</div>
								</div>
							</div>
							<a data-slide="prev" href="#carousel-245515"
								class="left carousel-control">‹</a> <a data-slide="next"
								href="#carousel-245515" class="right carousel-control">›</a>
						</div>
					</div>
				</div>
			</div>
			<form action="message_add" method="post">
				<div class="container-fluid" style="display: none" id="texteare1">
					<div>
						<textarea id="content1" name="message.content" cols="100" rows="8"
							style="width: 100%; height: 200px; visibility: hidden;"></textarea>
						<input name="user.id" type="hidden"
							value='<s:property value="#session.user.id" />' />
						<div class="col-xs-2" style="margin: -21.5% 0 0 83%">
							<input id="send1" name="send1" type="submit" onclick="sendText()"
								class="btn btn-block btn-sm btn-default " value="Go" />
						</div>
						<p>
							<%--您当前输入了 <span class="word_count1">0</span> 个文字。（字数统计包含HTML代码。）<br /> --%>
							您当前输入了 <span class="word_count2">0</span> 个文字。
							<!-- 							（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。） -->
						</p>
					</div>


				</div>
			</form>
			<%!private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
    }%>
			<!-- 内容展示 -->
			<div class="container">
				<s:if test="messageList!=null">
					<s:iterator value="messageList">
						<div class="demo-row">
							<div class="col-xs-14">
								<div class="demo-browser">
									<div class="demo-browser-side">
										<div class="demo-browser-author"></div>
										<div class="demo-browser-action">
											<a class="btn btn-danger btn-lg btn-block"
												href="http://twitter.com/monstercritic" target="_blank">
												<span class="fui-plus"></span>Follow
											</a>
										</div>
										<h5>
											<font face="Gungsuh" size="3px"><s:property
													value="user.username" /></font>
										</h5>
										<h6>
											<a><font face="Monotype Corsiva" size="3px"><s:property
														value="user.saywords" /></font></a> <br> <br>
											<s:date name="createtime" />


										</h6>

									</div>
									<div class="demo-browser-content">
										<div class="demo-browser-contentdiv">
											<s:property value="content" escape="false" />
										</div>
									</div>
								</div>
							</div>
						</div>
					</s:iterator>
				</s:if>
				<s:if test="messageList==null||messageList.isEmpty()">
					<div class="demo-row">
						<div class="col-xs-14">
							<div class="demo-browser">
								<div class="demo-browser-content">
									<div class="demo-browser-contentdiv">
										<s:property value="'记录不存在'" escape="false" />
									</div>
								</div>
							</div>
						</div>
					</div>
				</s:if>
			</div>
			<!-- /内容展示 container end -->
		</div>
		<!-- 		<div style="right:0px; bottom:0px; position:fixed; "><a href="javascript:scroll(0,0)" ><img alt="返回顶部" src=""></a></div> -->
		<!--总 container  end -->
	</s:if>
	<s:else>
		<jsp:include page="checkLogin.jsp"></jsp:include>
	</s:else>

	<!-- 	加载flat-ui -->

	<script src="dist/js/vendor/video.js"></script>
	<script src="dist/js/flat-ui.min.js"></script>
	<script src="docs/assets/js/application.js"></script>
</body>
<jsp:include page="foot.jsp"></jsp:include>
</html>
